//
//  RepairModel.m
//  KEREN
//
//  Created by MW on 2023/4/21.
//

#import "RepairModel.h"

@implementation RepairModel
+ (instancetype)initWithDictionary:(NSDictionary *)jsonDic{
    RepairModel *model = [[super alloc] init];
    [model setValuesForKeysWithDictionary:jsonDic];
    if(model.ebike_type_image){
        if([model.ebike_type_image hasPrefix:@"http"]){
            model.ebike_type_image  = jsonDic[@"ebike_type_image"];
        }else{
            model.ebike_type_image = [NSString stringWithFormat:@"%@%@",BaseimageUrl,model.ebike_type_image];
        }
        model.ebike_type_image = [model.ebike_type_image stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

    }
    return model;
}

-(id)valueForUndefinedKey:(NSString *)key
{
    return nil;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if([key isEqualToString:@"id"]){
        self.Id  = [value intValue];
    }
    if([key isEqualToString:@"ID"]){
        self.Id  = [value intValue];
    }

}

@end
